package com.coffee.daili.service.dao;

import com.coffee.daili.api.query.DailiOrderQuery;
import com.coffee.daili.api.result.DailiOrderListResult;
import com.coffee.daili.api.result.DailiOrderPageResult;
import com.coffee.daili.api.result.DailiSupplierOrderDetailResult;
import com.coffee.daili.api.result.DailiSupplierSubOrderResult;
import com.coffee.daili.service.bean.DailiOrder;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface DailiOrderDao {
    public DailiOrder findById(Integer id);

    public DailiOrder findByIdForUpdate(Integer id);

    public List<DailiOrder> findByIds(@Param("idList") List<Integer> idList);

    public Integer count(@Param("param") DailiOrderQuery param);

    public List<DailiOrder> page(@Param("param") DailiOrderQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public DailiOrder findFirst(@Param("param") DailiOrderQuery param);

    public Integer insert(DailiOrder param);

    Integer insertBatch(List<DailiOrder> list);

    public void updateById(@Param("param") DailiOrder param);

    public Integer deleteById(Integer id);

    public Integer deleteByIds(List<Integer> idList);

    public Map<String, Object> monthCount(@Param("date") String date, @Param("dailiMerchantPidPath") String dailiMerchantPidPath);

    public Map<String, Object> allCount(@Param("dailiMerchantPidPath") String dailiMerchantPidPath);

    public DailiSupplierSubOrderResult getDailiSupplierSubOrderResult(@Param("date") String date, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("dailiMerchantPidPath") String dailiMerchantPidPath);

    public List<DailiOrderPageResult> getDailiOrderPageResultPage(@Param("date") String date, @Param("dailiMerchantPid") String dailiMerchantPid, @Param("dailiMerchantId") Integer dailiMerchantId, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public Integer getDailiOrderPageResultCount(@Param("date") String date, @Param("dailiMerchantPid") String dailiMerchantPid, @Param("dailiMerchantId") Integer dailiMerchantId);

    public List<DailiOrderListResult> getDailiOrderListResult(@Param("status") String status,@Param("date") String date, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("dailiMerchantPidPath") String dailiMerchantPidPath, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public Integer getDailiOrderListCount(@Param("date") String date, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("dailiMerchantPidPath") String dailiMerchantPidPath);

    public Map<String, Object> countByDailiMerchantPidPath(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("dailiMerchantPidPath") String dailiMerchantPidPath);

    public DailiSupplierSubOrderResult getDailiSupplierSubOrderResultByEnjoySuccess(@Param("date") String date, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("dailiMerchantPidPath") String dailiMerchantPidPath);

    public DailiSupplierSubOrderResult getDailiSupplierSubOrderResultByEnjoyWait(@Param("date") String date, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("dailiMerchantPidPath") String dailiMerchantPidPath);

    public DailiSupplierSubOrderResult getDailiSupplierSubOrderResultByTotal(@Param("date") String date, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("dailiMerchantPidPath") String dailiMerchantPidPath);
}